package com.mapper;

import com.domain.Admin;
import com.domain.Comment;
import com.domain.User;
import org.apache.ibatis.annotations.*;

@Mapper
public interface AdminMapper {
    @Select("SELECT * FROM t_admin WHERE id =#{id}")
    public Admin findById(Integer id);

    @Insert("INSERT INTO t_admin(admin_name,pwd)" +
            "values (#{adminName},#{pwd})")
    public  int insertAdmin(Admin admin);

    @Update("UPDATE t_admin SET admin_name=#{adminName} WHERE id=#{id}")
    public int updateAdmin(Admin admin);

    @Delete("DELETE FROM t_Admin WHERE id=#{id}")
    public  int deleteAdmin(Admin id);

    @Select("SELECT * FROM t_admin WHERE admin_name=#{adminName} and pwd=#{pwd}")
    public Admin userLogin(Admin admin);
}
